home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2004 New Year / INTERNET112.ISO / pc / software / windows / building / easy_php / easyphp16_setup.exe / {app} / phpmyadmin / header.inc.php < prev    next >
Encoding:
PHP Script  |  2003-09-24  |  7.1 KB  |  175 lines

  1. <?php
  2. /* $Id: header.inc.php,v 1.48 2002/04/20 07:59:58 loic1 Exp $ */
  3.  
  4.  
  5. /**
  6.  * Gets a core script and starts output buffering work
  7.  */
  8. require('./libraries/common.lib.php');
  9. require('./libraries/ob.lib.php');
  10. if ($cfgOBGzip) {
  11.     $ob_mode = PMA_outBufferModeGet();
  12.     if ($ob_mode) {
  13.         PMA_outBufferPre($ob_mode);
  14.     }
  15. }
  16.  
  17.  
  18. /**
  19.  * Sends http headers
  20.  */
  21. // Don't use cache (required for Opera)
  22. $now = gmdate('D, d M Y H:i:s') . ' GMT';
  23. header('Expires: 0'); // rfc2616 - Section 14.21
  24. header('Last-Modified: ' . $now);
  25. header('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP/1.1
  26. header('Cache-Control: pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
  27. header('Pragma: no-cache'); // HTTP/1.0
  28. // Define the charset to be used
  29. header('Content-Type: text/html; charset=' . $charset);
  30.  
  31.  
  32. /**
  33.  * Sends the beginning of the html page then returns to the calling script
  34.  */
  35. // Gets the font sizes to use
  36. PMA_setFontSizes();
  37. // Defines the cell alignment values depending on text direction
  38. if ($text_dir == 'ltr') {
  39.     $cell_align_left  = 'left';
  40.     $cell_align_right = 'right';
  41. } else {
  42.     $cell_align_left  = 'right';
  43.     $cell_align_right = 'left';
  44. }
  45. ?>
  46. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  47.     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  48. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $available_languages[$lang][2]; ?>" lang="<?php echo $available_languages[$lang][2]; ?>" dir="<?php echo $text_dir; ?>">
  49.  
  50. <head>
  51. <title>phpMyAdmin</title>
  52. <?php
  53. if (!empty($cfgPmaAbsoluteUri)) {
  54.     echo '<base href="' . $cfgPmaAbsoluteUri . '" />' . "\n";
  55. }
  56. ?>
  57. <style type="text/css">
  58. <!--
  59. body            {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000; background-color: <?php echo $cfgRightBgColor; ?>}
  60. pre, tt         {font-size: <?php echo $font_size; ?>}
  61. th              {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; font-weight: bold; color: #000000; background-color: <?php echo $cfgThBgcolor; ?>}
  62. td              {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>}
  63. form            {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>}
  64. input           {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>}
  65. input.textfield {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000; background-color: #FFFFFF}
  66. select          {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000; background-color: #FFFFFF}
  67. textarea        {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000; background-color: #FFFFFF}
  68. h1              {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_bigger; ?>; font-weight: bold}
  69. A:link          {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; text-decoration: none; color: #0000FF}
  70. A:visited       {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; text-decoration: none; color: #0000FF}
  71. A:hover         {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; text-decoration: underline; color: #FF0000}
  72. A.nav:link      {font-family: <?php echo $right_font_family; ?>; color: #000000}
  73. A.nav:visited   {font-family: <?php echo $right_font_family; ?>; color: #000000}
  74. A.nav:hover     {font-family: <?php echo $right_font_family; ?>; color: #FF0000}
  75. .nav            {font-family: <?php echo $right_font_family; ?>; color: #000000}
  76. .warning        {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; font-weight: bold; color: #FF0000}
  77. //-->
  78. </style>
  79.  
  80. <?php
  81. $title     = '';
  82. if (isset($db)) {
  83.     $title .= str_replace('\'', '\\\'', $db);
  84. }
  85. if (isset($table)) {
  86.     $title .= (empty($title) ? '' : '.') . str_replace('\'', '\\\'', $table);
  87. }
  88. if (!empty($cfgServer) && isset($cfgServer['host'])) {
  89.     $title .= (empty($title) ? 'phpMyAdmin ' : ' ')
  90.            . sprintf($strRunning, (empty($cfgServer['verbose']) ? str_replace('\'', '\\\'', $cfgServer['host']) : str_replace('\'', '\\\'', $cfgServer['verbose'])));
  91. }
  92. $title     .= (empty($title) ? '' : ' - ') . 'phpMyAdmin ' . PMA_VERSION;
  93. ?>
  94. <script type="text/javascript" language="javascript">
  95. <!--
  96. // Updates the title of the frameset if possible (ns4 does not allow this)
  97. if (typeof(parent.document.title) == 'string') {
  98.     parent.document.title = '<?php echo $title; ?>';
  99. }
  100. <?php
  101. // Add some javascript instructions if required
  102. if (isset($js_to_run) && $js_to_run == 'functions.js') {
  103.     echo "\n";
  104.     ?>
  105. // js form validation stuff
  106. var errorMsg0   = '<?php echo str_replace('\'', '\\\'', $strFormEmpty); ?>';
  107. var errorMsg1   = '<?php echo str_replace('\'', '\\\'', $strNotNumber); ?>';
  108. var errorMsg2   = '<?php echo str_replace('\'', '\\\'', $strNotValidNumber); ?>';
  109. var noDropDbMsg = '<?php echo((!$cfgAllowUserDropDatabase) ? str_replace('\'', '\\\'', $strNoDropDatabases) : ''); ?>';
  110. var confirmMsg  = '<?php echo(($cfgConfirm) ? str_replace('\'', '\\\'', $strDoYouReally) : ''); ?>';
  111. //-->
  112. </script>
  113. <script src="libraries/functions.js" type="text/javascript" language="javascript"></script>
  114.     <?php
  115. } else if (isset($js_to_run) && $js_to_run == 'user_details.js') {
  116.     echo "\n";
  117.     ?>
  118. // js form validation stuff
  119. var jsHostEmpty       = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strHostEmpty']); ?>';
  120. var jsUserEmpty       = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strUserEmpty']); ?>';
  121. var jsPasswordEmpty   = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordEmpty']); ?>';
  122. var jsPasswordNotSame = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordNotSame']); ?>';
  123. //-->
  124. </script>
  125. <script src="libraries/user_details.js" type="text/javascript" language="javascript"></script>
  126.     <?php
  127. } else if (isset($js_to_run) && $js_to_run == 'indexes.js') {
  128.     echo "\n";
  129.     ?>
  130. // js index validation stuff
  131. var errorMsg0   = '<?php echo str_replace('\'', '\\\'', $strFormEmpty); ?>';
  132. var errorMsg1   = '<?php echo str_replace('\'', '\\\'', $strNotNumber); ?>';
  133. var errorMsg2   = '<?php echo str_replace('\'', '\\\'', $strNotValidNumber); ?>';
  134. //-->
  135. </script>
  136. <script src="libraries/indexes.js" type="text/javascript" language="javascript"></script>
  137.     <?php
  138. } else if (isset($js_to_run) && $js_to_run == 'tbl_change.js') {
  139.     echo "\n";
  140.     ?>
  141. //-->
  142. </script>
  143. <script src="libraries/tbl_change.js" type="text/javascript" language="javascript"></script>
  144.     <?php
  145. } else {
  146.     echo "\n";
  147.     ?>
  148. //-->
  149. </script>
  150.     <?php
  151. }
  152. echo "\n";
  153. ?>
  154. </head>
  155.  
  156.  
  157. <body bgcolor="<?php echo $cfgRightBgColor; ?>" background="images/bkg.gif">
  158. <?php
  159. if (isset($db)) {
  160.     echo '<h1>' . $strDatabase . ' <i>' . htmlspecialchars($db) . '</i>';
  161.     if (!empty($table)) {
  162.         echo ' - ' . $strTable . ' <i>' . htmlspecialchars($table) . '</i>';
  163.     }
  164.     echo ' ' . sprintf($strRunning, ' <i>' . (($cfgServer['verbose']) ? $cfgServer['verbose'] : $cfgServer['host']) . '</i>');
  165.     echo '</h1>' . "\n";
  166. }
  167. echo "\n";
  168.  
  169.  
  170. /**
  171.  * Sets a variable to remember headers have been sent
  172.  */
  173. $is_header_sent = TRUE;
  174. ?>
  175.